package com.neusoft.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

@FeignClient(name="virtualWallet-server", 
             url="http://localhost:10700",  // 添加直接URL
             fallback = VirtualWalletFeignClientCallBack.class)
public interface VirtualWalletFeignClient {
    
    @PostMapping("/VirtualWalletController/transfer")
    void transfer(@RequestParam("fromWalletId") Integer fromWalletId, 
                  @RequestParam("toWalletId") Integer toWalletId, 
                  @RequestParam("amount") BigDecimal amount);

    // 新增credit方法，用于给钱包充值
    @PostMapping("/VirtualWalletController/{walletId}/credit")
    void credit(@PathVariable("walletId") Integer walletId,
            @RequestParam("amount") BigDecimal amount);
}
